﻿using System;
using System.Collections.Generic;
using System.Text;
using OpenPOP.MIMEParser;

namespace FaxServerNET.Security
{
    class EmailAddressFilter : ISecurityProvider
    {
        public string ValidDomainName { get; set; }
        public bool CanSendFax(Message email_msg)
        {
            bool can_send = false;
            string[] from_parts = email_msg.FromEmail.Split('@');
            if (from_parts.Length>1)
            {
                can_send = (from_parts[1] == ValidDomainName);
            }
            return can_send;
        }
    }
}
